package com.six.security.handle;

import com.six.core.vo.Result;
import com.six.security.exception.PermissionException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author: WangPeng
 * @createTime: 2023/02/23 17:13
 * @description:
 * @version: v1.0
 */
@RestControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(value = PermissionException.class)
    public Result permissionException(PermissionException e){
        return new Result(401,e.getMessage());
    }
}
